#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
//平方算法 O(n^2）最大计算n=1e5规模
    ll M, p, q, k, s;
    //p+(p+1)+...+q=M
    cin >> M;
    for (p = 1; p <= M / 2; p++)
        for (q = p + 1; q <= M; q++) {
            s = (q - p + 1) * (p + q) / 2;
            if (s == M) {
                cout << p << " " << q << endl;
            }
        }


    return 0;
}
